package engine.gui.events;

import java.io.Serializable;


public abstract class OnClickEvent implements IOnClick, Serializable{

	private static final long serialVersionUID = 1L;

	private EventMethod function ; 
	
	public OnClickEvent(){
	}
	
	@Override
	public void click() {
		if(!(function == null))
			function.start(); 
	}

	@Override
	public void onClick() {
		this.click(); 
	}

	@Override
	public void onClick(EventMethod newEvent) {
		this.function = newEvent ; 
	}

}
